<template>
  <div :class="`house house${pType}`"></div>
</template>

<script lang="ts" >
import {defineComponent, toRefs} from "vue";
export default defineComponent({
  name: 'house',
  components: {},
  props: {
    pType: {
      type: Number,
      default: 0
    }
  },
  setup(props) {
    const { pType } = toRefs(props);
    return {
      pType
    };
  }
})
</script>

<style lang="less" scoped>
.house{
  display: flex;
  width: 90px;
  height: 90px;
  margin: 6px 0 5px;
  background-image: url("/src/assets/img/house.png");
  border-radius: 4px;
  justify-content: center;
  align-content: center;
  align-items: center;

  &~p{
    width: 100px;
    font-size: 12px;
    text-align: center;
  }

  &.house0{
    background-position: -180px 0; //其他
  }

  &.house1{
    background-position: 0 0;  //房建
  }

  &.house2{
    background-position: -90px 0;  //市政
  }
}

</style>

